package com.sinopec.android;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;

import com.sinopec.android.bean.Conference;
import com.sinopec.android.bean.ResultData;
import com.sinopec.android.bean.ThreadCallBack;

/**
* @ClassName: ConferenceDetailActivity
* @Description: TODO(会议管理详情)
* @author liuwei
* @date 2012-4-17 下午05:48:48
* 
*/
public class ConferenceDetailActivity extends BaseActivity implements
		OnClickListener, ThreadCallBack {
	Conference conference;
	
	TextView conference_name_textview,conference_content_textview,
		conference_time_textview,conference_address_textview,
		conference_zhuchiren_textview,conference_leader_textview,
		conference_dept_textview,conference_contact_textview;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.conference_detail_view);
		conference = (Conference) getIntent().getSerializableExtra("conference");
		initView();
	}
	void  initView(){
		((TextView)findViewById(R.id.navi)).setText("会议详情");
		conference_name_textview = (TextView) findViewById(R.id.conference_name_textview);
		conference_content_textview =  (TextView) findViewById(R.id.conference_content_textview);
		conference_time_textview  = (TextView) findViewById(R.id.conference_time_textview);
		conference_address_textview = (TextView) findViewById(R.id.conference_address_textview);
		conference_zhuchiren_textview =  (TextView) findViewById(R.id.conference_zhuchiren_textview);
		conference_leader_textview =  (TextView) findViewById(R.id.conference_leader_textview);
		conference_dept_textview = (TextView) findViewById(R.id.conference_dept_textview);
		conference_contact_textview = (TextView) findViewById(R.id.conference_contact_textview);
		
		if(conference!=null){
			conference_name_textview.setText(conference.getTitle());
			conference_content_textview.setText(conference.getContent());
			try{
				String[] time = conference.getTime().trim().split(" ");
				conference_time_textview.setText(time[0]+" "+time[1]+"\n"+time[2]+"至"+time[3]);
			}catch (Exception e) {
				// TODO: handle exception
				conference_time_textview.setText(conference.getTime());
			}
			conference_address_textview.setText(conference.getAddress());
			conference_zhuchiren_textview.setText(conference.getHolder());
			conference_leader_textview.setText(conference.getLeader());
			conference_dept_textview.setText(conference.getAttender());
			conference_contact_textview.setText(conference.getContract());
		}
	}
	@Override
	public void onCallbackFromThread(ResultData resultData) {
		// TODO Auto-generated method stub

	}

	@Override
	public void onClick(View arg0) {
		// TODO Auto-generated method stub

	}

}
